"
Implements a command available in the method context menu of Calypso. When activated a new system browser will be opened on the test method of the current browser's selected method.

"
Class {
	#name : 'ClyOpenTestMethodCommand',
	#superclass : 'ClyJumpToTestMethodCommand',
	#category : 'Calypso-SystemPlugins-SUnit-Browser-Commands',
	#package : 'Calypso-SystemPlugins-SUnit-Browser',
	#tag : 'Commands'
}

{ #category : 'testing' }
ClyOpenTestMethodCommand class >> canBeExecutedInContext: aBrowserContext [
	"Only present this menu item in query results presenters"

	^ 	aBrowserContext isQueryBrowserContext and: [ self hasInstanceSelectedItemsIn: aBrowserContext ]
]

{ #category : 'activation' }
ClyOpenTestMethodCommand class >> methodMenuActivation [
	<classAnnotation>

	^ CmdContextMenuActivation 
		byItemOf: ClySUnitMethodMenuGroup 
		order: 12
		for: ClyMethod asCalypsoItemContext
]

{ #category : 'activation' }
ClyOpenTestMethodCommand class >> methodShortcutActivation [
	<classAnnotation>
	^ CmdShortcutActivation by: $t meta , $o meta for: ClyMethod asCalypsoItemContext
]

{ #category : 'accessing' }
ClyOpenTestMethodCommand >> defaultMenuItemName [

	^ 'Open test method'
]

{ #category : 'accessing' }
ClyOpenTestMethodCommand >> description [

^ 'Open a new system browser on the test method of the current browser''s selected method.'
]

{ #category : 'execution' }
ClyOpenTestMethodCommand >> execute [

	self methods do: [ :method | self generateTestMethodFor: method ].
	testMethodToBrowse ifNotNil: [ :testMethod | 
		browser 
			spawnBrowser: ClyFullBrowserMorph 
			withState: [ :b | b selectMethod: testMethod ] ]
]
